﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class Icon_PlayerSetting : MonoBehaviour
{
    public int Level
    {
        get
        {
            if (!this.name.Contains("XS"))
            {
                return int.Parse(this.transform.GetChild(2).GetChild(0).GetComponent<Text>().text);
            }
            else
                return -1;
        }
        set
        {
            if (!this.name.Contains("XS"))
            {
                this.transform.GetChild(2).GetChild(0).GetComponent<Text>().text = value.ToString();
            }
        }
    }

    public Sprite Box
    {
        get
        {
            return this.transform.GetChild(1).GetComponent<Image>().sprite;
        }
        set
        {
            this.transform.GetChild(1).GetComponent<Image>().sprite = value;
        }
    }
    public Sprite Icon
    {
        get
        {   
            return this.transform.GetChild(0).GetComponent<Image>().sprite;
        }
        set
        {
            this.transform.GetChild(0).GetComponent<Image>().sprite = value;
        }
    }
}
